<form action="{{$route}}" class="form-horizontal" pjax-container="" method="get">
    <div class="row">
        <div class="col-md-12">
            <div class="box-body">
                <div class="fields-group">
                    <div class="form-group">
                        <label class="col-sm-2 control-label"> 时间选择</label>
                        <div class="col-sm-2" style="width: 390px">
                            <div class="input-group input-group-sm">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input name="startTime" autocomplete="off" class="form-control" type="text" id="startTime" value="{{empty(request()->input('startTime'))?date('Y', time()).'-01-01':request()->input('startTime')}}">
{{--                                <input name="endTime" autocomplete="off" class="form-control" type="text" id="endTime" value="{{empty(request()->input('endTime'))?date('Y-m-d', time()):request()->input('endTime')}}">--}}
                                <script src="/laydate/laydate.js"></script> <!-- 改成你的路径 -->
                                <script>
                                //执行一个laydate实例
                                laydate.render({
                                  elem: '#startTime',
                                    value:'',
                                  done: function (value) {
                                      $('#startTime').attr('value', value);
                                    var endtime = $('#endTime').attr('value');
                                    $('#submit').attr('href', '{{$route}}?startTime='+value+'&endTime='+endtime);
                                  }
                                });
                                </script>
                            </div>
                        </div>
                        <div class="col-sm-2" style="width: 390px">
                            <div class="input-group input-group-sm">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input name="endTime" autocomplete="off" class="form-control" type="text" id="endTime" value="{{empty(request()->input('endTime'))?date('Y-m-d', time()):request()->input('endTime')}}">
{{--                                <script src="/laydate/laydate.js"></script> <!-- 改成你的路径 -->--}}
                                <script>
                                //执行一个laydate实例
                                laydate.render({
                                  elem: '#endTime',
                                  value: '{{date('Y-m-d', time())}}',
                                  done:function (value) {
                                    $('#endTime').attr('value', value);
                                    var starttime = $('#startTime').attr('value');
                                    $('#submit').attr('href', '{{$route}}?startTime='+starttime+'&endTime='+value);
                                  }
                                });
                                </script>
                            </div>
                        </div>
                        <div class="btn-group pull-left">
{{--                            <button id="submit" target="_blank" class="btn btn-info submit btn-sm"><i class="fa fa-upload"></i>&nbsp;&nbsp;导出</button>--}}
                            <a href="{{$route.'?startTime=&endTime='.date('Y-m-d', time())}}" id="submit" target="_blank" class="btn btn-info btn-sm"><i class="fa fa-upload"></i>&nbsp;&nbsp;导出</a>
                        </div>
                        <div class="btn-group pull-left " style="margin-left: 10px;">
                            <a href="{{$routeIndex}}?_pjax=%23pjax-container" class="btn btn-default btn-sm"><i class="fa fa-undo"></i>&nbsp;&nbsp;重置</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>